#!/bin/bash

getopt -Qn 'Error' hp:f:m: "$@"
if [ $# = 0 ];
then echo usage: start_partition -p [\"partition name\"] -f [\"profile name\"] -m [\"managed system]
exit 1
fi
if [ $1 = '-h' ];
then echo
echo usage: start_partition -p [\"partition name\"] -f [\"profile name\"] -m [\"managed system\"]
echo '     ' activate the profile for the partition on the managed system for the HSC
echo '              ' profile, partition, and managed system name MUST be enclosed in 
echo '                                                            ' double quotes \" \"
echo
echo Options:
echo '   ' -p used to identify the partition
echo '   ' -f used to identify the profile name
echo '   ' -m used to identify the managed system the partition resides on
echo '   ' -h brings up this help screen
echo
exit 0
fi

export CLASSPATH=/usr/websm/codebase/pluginjars/hmcdebug.jar:/opt/hsc:/usr/websm/codebase/pluginjars/sniacimom.jar:/usr/websm/codebase/pluginjars/xerces.jar:/usr/websm/codebase/pluginjars/HwmcaCommon.jar:/usr/websm/codebase/pluginjars/auifw.jar:$CLASSPATH
export PATH=/opt/IBMJava2-13/jre/bin:$PATH
if [ $# -eq 6 ];
then java -Djavax.net.ssl.keyStore=/usr/websm/codebase/SM.pubkr -Djavax.net.ssl.keyStorePassword=defp -DcimomConfigFile=/opt/hsc/data/cimomcfg.properties com.ibm.hsc.common.util.StartPartition "\"$2\"" "\"$4\"" "\"$6\""
exit 0
fi
echo Usage: start_partition -p [\"partition name\"] -f [\"profile name\"] -m [\"managed system\"]
exit 1
